package com.dragon.repository.domain.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.dragon.common.util.BeanUtils;
import com.dragon.repository.entity.Accountrecordss;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AccountrecordssDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "合同id")
    private Integer contractId;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "访问时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty(value = "拜访方式：")
    private Integer manner;

    @ApiModelProperty(value = "服务内容")
    private String serviceitem;

    @ApiModelProperty(value = "反馈")
    private String feedback;

    @ApiModelProperty(value = "客户受访人")
    private String visitName;

    @ApiModelProperty(value = "受访人手机号")
    private String visitPhone;

    @ApiModelProperty(value = "状态：0：未审核,1通过2不通过 3.审核中")
    private Integer status;

    @ApiModelProperty(value = "客户id")
    private Integer customerId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "跟进人id")
    private Integer recordId;

    @ApiModelProperty(value = "部门id")
    private Integer departmentId;

    @ApiModelProperty(value = "审核人id")
    private Integer auditId;

    @ApiModelProperty(value = "审核备注")
    private String auditContent;

    @ApiModelProperty(value = "审核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date auditTime;

    @ApiModelProperty(value = "删除时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deleteTime;

    @ApiModelProperty(value = "删除标识：0未删除，1删除")
    private Integer deleted;

    @ApiModelProperty(value = "描述信息")
    private String description;

    @ApiModelProperty(value = "项目名称")
    @TableField(exist = false)
    private String projectName;

    @ApiModelProperty(value = "客户名称")
    @TableField(exist = false)
    private String customerName;


    public AccountrecordssDTO() {}

    public AccountrecordssDTO(Accountrecordss entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static AccountrecordssDTO convert(Accountrecordss entity) {
        return new AccountrecordssDTO(entity);
    }

    public static List<AccountrecordssDTO> convertList(List<Accountrecordss> list) {
        List<AccountrecordssDTO> resultList = new ArrayList<>();
        for (Accountrecordss entity : list) {
            resultList.add(new AccountrecordssDTO(entity));
        }
        return resultList;
    }}
